<template>
  <div class="news">
    <div class="top-info">
      您的位置：获奖作品 > <span>详情页</span>
    </div>
    <div class="news-nav">
      <h1 class="title">{{ worksDetails.title }}</h1>
      <p class="time">
        {{ dayjs(worksDetails.created_at * 1000).format("YYYY-MM-DD HH:mm:ss") }}
      </p>
      <div class="rich-text" v-html="worksDetails.content"></div>
    </div>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  name: "news",
  components: {},
  data() {
    return {};
  },
  mounted() {
    this.getDetail();
  },
  methods: {
    ...mapActions(["getWorksDetails"]),
    getDetail() {
      let data = {
        id: this.$route.query.id,
      };
      this.getWorksDetails(data);
    },
  },
  computed: {
    ...mapGetters(["worksDetails"]),
  },
};
</script>
<style scoped>
.news {
  padding: 0 0 100px;
  width: 1200px;
  margin: 0 auto;
}
.top-info {
  margin: 30px 0 40px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #666666;
}
.top-info span {
  color: #0e93e4;
}
.news-nav .title {
  font-size: 24px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #000000;
}
.news-nav .time {
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #999999;
  margin: 10px 0 40px;
}
.news-nav .source {
  margin-right: 10px;
}
</style>